<?
  include('../init.php');

  $id= $_POST["id"];
  $old_cert= $_POST["old_cert"];
  
  $db->execute("UPDATE projects SET project_cert='' WHERE project_id = '$id'");
  
  if(file_exists('../../images/projects/'.$id.'/'.$old_cert)){
    unlink('../../images/projects/'.$id.'/'.$old_cert);
  }

  echo 'success';
?>